home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / zbpc_460.zip / UTILITY.EXE / KEY.BAS < prev    next >
BASIC Source File  |  1991-06-06  |  17KB  |  360 lines

  1. 00004 REM: key.z
  2. 00010 REM: WRITTEN BY JOE PHILLIPS, 1991, Modifications for 4.6 by Harry A. Gish
  3. 00050 CLEAR:DIM 50IN$(650),LX(10),LY(10)
  4. 00052 :REM ==  Key Values for ease of Key recognition.
  5. 00054 :REM ==  Note : Extended Key Values ( LEN = 2 ) have 128 added to their
  6. 00056 :REM ==         KeyValue if you use the input routine provided.
  7. 00058 BACKSP  = 8:       PGUP  = 201:      CTRLPGUP = 138:
  8. 00060 T_A_B   = 9:       PGDN  = 209:      CTRLPGDN = 246:
  9. 00062 ENTER   = 13:      E_N_D = 207:      CTRLE_N_D= 245:
  10. 00064 ESC     = 27:      HOME  = 199:      CTRLHOME = 247:
  11. 00066 ST_A_B  = 143:     INS   = 210:      DEL      = 211:
  12. 00068 LArrow    = 203:      CTRLLArrow    = 243:
  13. 00070 RArrow    = 205:      CTRLRArrow    = 244:
  14. 00072 UArrow    = 200:
  15. 00074 DArrow    = 208:
  16. 00076 CTRLA  = 1:          ALTA  = 158:        ALT1 = 248:
  17. 00078 CTRLB  = 2:          ALTB  = 176:        ALT2 = 249:
  18. 00080 CTRLC  = 3:          ALTC  = 174:        ALT3 = 250:
  19. 00082 CTRLD  = 4:          ALTD  = 160:        ALT4 = 251:
  20. 00084 CTRLE  = 5:          ALTE  = 146:        ALT5 = 252:
  21. 00086 CTRLF  = 6:          ALTF  = 161:        ALT6 = 253:
  22. 00088 CTRLG  = 7:          ALTG  = 162:        ALT7 = 254:
  23. 00090 CTRLH  = 8:          ALTH  = 163:        ALT8 = 255:
  24. 00092 CTRLI  = 9:          ALTI  = 151:        ALT9 = 134:
  25. 00094 CTRLJ  = 10:         ALTJ  = 164:        ALT0 = 135:
  26. 00096 CTRLK  = 11:         ALTK  = 165:        ALTMINUS  = 136:
  27. 00098 CTRLL  = 12:         ALTL  = 166:        ALTEQUALS = 137:
  28. 00100 CTRLM  = 13:         ALTM  = 178:
  29. 00102 CTRLN  = 14:         ALTN  = 177:
  30. 00104 CTRLO  = 15:         ALT_O  = 152:
  31. 00106 CTRLP  = 16:         ALTP  = 153:
  32. 00108 CTRLQ  = 17:         ALTQ  = 144:
  33. 00110 CTRLR  = 18:         ALTR  = 147:
  34. 00112 CTRLS  = 19:         ALTS  = 159:
  35. 00114 CTRLT  = 20:         ALTT  = 148:
  36. 00116 CTRLU  = 21:         ALTU  = 150:
  37. 00118 CTRLV  = 22:         ALTV  = 175:
  38. 00120 CTRLW  = 23:         ALTW  = 145:
  39. 00122 CTRLX  = 24:         ALTX  = 173:
  40. 00124 CTRLY  = 25:         ALTY  = 149:
  41. 00126 CTRLZ  = 26:         ALTZ  = 172:
  42. 00128 F1  = 187:              SF1  = 212:
  43. 00130 F2  = 188:              SF2  = 213:
  44. 00132 F3  = 189:              SF3  = 214:
  45. 00134 F4  = 190:              SF4  = 215:
  46. 00136 F5  = 191:              SF5  = 216:
  47. 00138 F6  = 192:              SF6  = 217:
  48. 00140 F7  = 193:              SF7  = 218:
  49. 00142 F8  = 194:              SF8  = 219:
  50. 00144 F9  = 195:              SF9  = 220:
  51. 00146 F10 = 196:              SF10 = 221:
  52. 00148 F11 = 139:              SF11 = 141:
  53. 00150 F12 = 140:              SF12 = 142:
  54. 00152 CTRLF1  = 222:          ALTF1  = 232:
  55. 00154 CTRLF2  = 223:          ALTF2  = 233:
  56. 00156 CTRLF3  = 224:          ALTF3  = 234:
  57. 00158 CTRLF4  = 225:          ALTF4  = 235:
  58. 00160 CTRLF5  = 226:          ALTF5  = 236:
  59. 00162 CTRLF6  = 227:          ALTF6  = 237:
  60. 00164 CTRLF7  = 228:          ALTF7  = 238:
  61. 00166 CTRLF8  = 229:          ALTF8  = 239:
  62. 00168 CTRLF9  = 230:          ALTF9  = 240:
  63. 00170 CTRLF10 = 231:          ALTF10 = 241:
  64. 00172 CTRLF11 = 154:          ALTF11 = 156:
  65. 00174 CTRLF12 = 155:          ALTF12 = 157:
  66. 00176 DIM 2TmpKey$, 2Isaskist$
  67. 00178 DEF FN F_Isaski(Isaskist$) = ( (VAL(Isaskist$)>31) AND (VAL(Isaskist$)<127) AND (LEN(Isaskist$)=1) )
  68. 00180 LONG FN Key$
  69. 00182 TmpKey$ = ""
  70. 00184 WHILE TmpKey$ = ""
  71. 00186 TmpKey$ = INKEY$
  72. 00188 WEND
  73. 00190 LONG IF ( LEN(TmpKey$) = 2 )
  74. 00192 TPKey$ = RIGHT$(TmpKey$,1)
  75. 00194 KeyValue = ASC(TPKey$)+128
  76. 00196 XELSE
  77. 00198 KeyValue = ASC(TmpKey$)
  78. 00200 END IF
  79. 00202 :REM - Notice the following values are not inclusive
  80. 00204 Isaski = ( KeyValue > 31 ) AND ( KeyValue < 127 )
  81. 00206 END FN = TmpKey$
  82. 00208 DIM 2KY$
  83. 00210 LONG FN FCTKey
  84. 00212 REM    Will Only allow a Function Key or Escape Key to be pressed
  85. 00214 SVVL = 0
  86. 00216 WHILE SVVL = 0
  87. 00218 KY$ = FN Key$
  88. 00220 LONG IF ( KeyValue >= F1 ) AND ( KeyValue <= F10 )
  89. 00222 SVVL = KeyValue - F1 + 1
  90. 00224 XELSE
  91. 00226 IF KeyValue = ESC THEN SVVL = -1
  92. 00228 END IF
  93. 00230 WEND
  94. 00232 END FN = SVVL
  95. 00234 LONG FN WAITKey
  96. 00236 :REM Assert : No Key Value Returned
  97. 00238 JUNK$ = FN Key$
  98. 00240 END FN   :REM WaitKey
  99. 00242 :REM                                                                    :
  100. 00244 :REM                                                                    :
  101. 00246 :REM End Of Key Value Definitions And Related Routines                  :
  102. 00248 :REM---------------------------------------------------------------------
  103. 00250 :REM---------------------------------------------------------------------
  104. 00252 :REM FN Edit$                                                           :
  105. 00254 :REM Joe Phillips - 1991                                                :
  106. 00256 :REM Created For  I.S.D., Inc                                           :
  107. 00258 :REM--------------------------------------------------------------------:
  108. 00260 TRUE = (1=1):FALSE = (1=0) :REM This is to assure theses values are set
  109. 00262 LONG FN Edit_DFLTS( F_C, B_C, FR_C, BR_C, FC, EB, EL )
  110. 00264 :REM  Defaults for FN Edit$ may be set in this function
  111. 00266 :REM
  112. 00268 Edit_F  = F_C                     :REM Fore Ground COLOR When Editting
  113. 00270 Edit_B  = B_C                     :REM Back Ground COLOR When Editting
  114. 00272 Edit_FR = FR_C                    :REM Fore Ground COLOR When Not Editting
  115. 00274 Edit_BR = BR_C                    :REM Back Ground COLOR When Not Editting
  116. 00276 Edit_FLCH = FC                    :REM Default Fill Character, see below
  117. 00278 Edit_BRKT = EB                    :REM Switch to Display Brackets (TRUE = on )
  118. 00280 :REM                            (FALSE= Off )
  119. 00282 Edit_LEAVE  = EL                    :REM Switch to Leave if field Full
  120. 00284 :REM           TRUE = Leave when Full
  121. 00286 :REM Some Possibles for Fill Character
  122. 00288 :REM  250  [······]   176  [░░░]  95  [_]  45  [-]  32  [ ]
  123. 00290 END FN  :REM Edit_Dflts
  124. 00292 :REM
  125. 00294 :REM Set Parameters in case the user forgets
  126. 00296 :REM    The following lines of code will be executed at program start. Therefore,
  127. 00298 :REM    if you set the variables by hand, you might have trouble. Use the
  128. 00300 :REM    function provided !!!!! ( FN Edit_Dflt )
  129. 00302 Edit_F    = 7
  130. 00304 Edit_B    = 0
  131. 00306 Edit_FR   = 7
  132. 00308 Edit_BR   = 0
  133. 00310 Edit_FLCH = 32
  134. 00312 Edit_BRKT = (1=1)  REM Turn On Brackets
  135. 00314 Edit_LEAVE  = (1=1)
  136. 00316 :
  137. 00318 LONG FN Edit$( OLD$, COL, ROW,LGTH_Z, Edit_FMT ,Edit_Z)
  138. 00320 :REM   ***** Important, this routine must be included after "Key$.FN" :
  139. 00322 :
  140. 00324 :REM Edit_Fmt = 0  is AlphaNumeric ALL UPPER CASE
  141. 00326 :REM Edit_Fmt = 1  is Numeric-Only ( POSITIVE INTEGER )
  142. 00328 :REM Edit_Fmt = 2  is AlphaNumeric Upper and Lower
  143. 00330 :REM Edit_Fmt = 3  is YN Format ( case-insensitive )
  144. 00332 :REM Edit_Fmt = 4  is Numeric ( Negative and Real Numbers ( Decimal Point ) )
  145. 00334 :REM
  146. 00336 :REM All termination Keys save the data except ESC which restores the returned
  147. 00338 :REM value to pre-Edit status.
  148. 00340 :REM For Now Termination Keys Are : Enter, DArrow, UArrow, T_A_B,
  149. 00342 :REM                                Shift_T_A_B, PgUp,PgDn, Function
  150. 00344 :REM                                Keys 1-10, ESC
  151. 00346 :
  152. 00348 :REM KeyValue - A global variable with the code of the final Key pressed.
  153. 00350 :REM           It is returned by FN Key$
  154. 00352 :REM Edit_Z  - The current Offset of Edit cursor ( 1 = Left Most Position )
  155. 00354 :REM Lgth_Z  - The Maximum length of the data being entered.
  156. 00356 :REM           Data is buffered out to that length by spaces.
  157. 00358 :REM Row,Col - X,Y Cordinates of start of data on screen ( 0,0 relative )
  158. 00360 :REM ThisPtr - The Pointer to beginning of data for easy updating
  159. 00362 :REM Edit_Ins   - BOOLEAN variable that indicates Insert Mode ( Not Relative
  160. 00364 :REM           to Keyboard Indicator )
  161. 00366 :REM ReWrt   - BOOLEAN variable that is set to TRUE when the entire
  162. 00368 :REM           string needs to be re-written on the screen
  163. 00370 :REM TempOld$- Contains data while being Editted
  164. 00372 :REM Z_Key$  - Actual character returned from FN Key$
  165. 00374 :REM Edit_Leave- BOOLEAN variable to indicate if the Edit$ should be exitted
  166. 00376 :REM           when the field is full
  167. 00378 :REM
  168. 00380 IF Edit_FMT > 89 THEN Edit_FMT = Edit_FMT - 90
  169. 00382 PSTR$(Alpha%) = "0123456789.- ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.,!@ #$%^&*()_-=+][}{':;/?.>,<\|"
  170. 00384 Edit_Z = 1         :REM Set Cursor To Left Most Position
  171. 00386 SP_C = 32          :REM Ascii Value Of The space Character
  172. 00388 TEMPOLD$ = OLD$ + STRING$(LGTH_Z-LEN(OLD$),Edit_FLCH)
  173. 00390 Thisptr  = VARPTR(TEMPOLD$)
  174. 00392 COLOR ,(Edit_B<<4)+Edit_F
  175. 00394 LONG IF Edit_BRKT
  176. 00396 LOCATE COL-1,ROW,0    :PRINT "["
  177. 00398 LOCATE COL+LGTH_Z,ROW,0:PRINT "]"
  178. 00400 END IF
  179. 00402 REWRT = TRUE
  180. 00404 Edit_INS = FALSE
  181. 00406 :REM === Enter Infinite Loop ( You'll See......... )
  182. 00408 WHILE (1=1)
  183. 00410 :REM == Check to see if string needs to be updated on screen
  184. 00412 :REM    the 0 in locate turns off the cursor
  185. 00414 LONG IF REWRT
  186. 00416 LOCATE COL,ROW,0
  187. 00418 PRINT TEMPOLD$
  188. 00420 REWRT = FALSE
  189. 00422 END IF
  190. 00424 LONG IF Edit_INS                  :REM Assert - Set Size Of Cursor
  191. 00426 LOCATE COL+Edit_Z-1,ROW,1,0,7
  192. 00428 XELSE
  193. 00430 LOCATE COL+Edit_Z-1,ROW,1,6,7
  194. 00432 END IF
  195. 00434 Z_Key$ = FN Key$
  196. 00436 :REM ============= The Following Keys Will Leave Edit
  197. 00438 :
  198. 00440 IF KeyValue = DArrow   THEN "Leave Edit Loop"
  199. 00442 IF KeyValue = UArrow   THEN "Leave Edit Loop"
  200. 00444 IF KeyValue = PGDN   THEN "Leave Edit Loop"
  201. 00446 IF KeyValue = PGUP   THEN "Leave Edit Loop"
  202. 00448 IF KeyValue = ENTER  THEN "Leave Edit Loop"
  203. 00450 IF KeyValue = T_A_B  THEN "Leave Edit Loop"
  204. 00452 IF KeyValue = ESC    THEN "Leave Edit Loop"
  205. 00454 IF KeyValue = ST_A_B THEN "Leave Edit Loop"
  206. 00456 IF KeyValue >= F1 AND KeyValue <= F10 THEN "Leave Edit Loop"
  207. 00458 :
  208. 00460 :REM  ===== Check For Edit Control Keys
  209. 00462 IF KeyValue = LArrow      THEN "Edit Left Arrow"
  210. 00464 IF KeyValue = RArrow      THEN "Edit Right Arrow"
  211. 00466 IF KeyValue = BACKSP    THEN "Edit Back Space"
  212. 00468 IF KeyValue = INS       THEN "Edit Insert Key"
  213. 00470 IF KeyValue = HOME      THEN "Edit Home Key"
  214. 00472 IF KeyValue = E_N_D     THEN "Edit End Key"
  215. 00474 IF KeyValue = DEL       THEN "Edit Delete Key"
  216. 00476 IF KeyValue = CTRLE_N_D THEN "Edit Ctrl End"
  217. 00478 GOTO                        "No Control Key Pressed"
  218. 00480 "Edit Ctrl End"  REM                 ========== Ctrl End  ============
  219. 00482 :REM Deletes Under Cursor and All to right
  220. 00484 FOR IZ = Edit_Z TO LGTH_Z
  221. 00486 POKE Thisptr+IZ,Edit_FLCH
  222. 00488 NEXT IZ
  223. 00490 GOTO "Edit Bottom"
  224. 00492 "Edit Insert Key"REM                 ========== Insert Key ===========
  225. 00494 : REM Just Toggle Insert State "Edit_Ins"
  226. 00496 Edit_INS = NOT Edit_INS
  227. 00498 GOTO "Edit Bottom"
  228. 00500 "Edit Delete Key"REM                ============ Delete Key ===============
  229. 00502 :REM Deletes character under the cursor and "pulls" data to the
  230. 00504 :REM  right of the cursor one position to the left.
  231. 00506 LONG IF Edit_Z <> LGTH_Z
  232. 00508 FOR IZ = Edit_Z TO LGTH_Z-1
  233. 00510 POKE Thisptr+IZ, PEEK(Thisptr+IZ+1)
  234. 00512 NEXT IZ
  235. 00514 END IF
  236. 00516 :REM == Don't Forget To Fill In last Character With blank
  237. 00518 POKE Thisptr+LGTH_Z,Edit_FLCH
  238. 00520 REWRT = TRUE
  239. 00522 GOTO "Edit Bottom"
  240. 00524 "Edit Left Arrow" REM                     ========= Left Arrow ==============
  241. 00526 IF ( Edit_Z = 1 ) THEN "Edit Beep Bottom"
  242. 00528 Edit_Z = Edit_Z -1
  243. 00530 GOTO "Edit Bottom"
  244. 00532 "Edit Right Arrow" REM                     ========= Right Arrow ============
  245. 00534 IF ( Edit_Z = LGTH_Z) THEN "Edit Beep Bottom"
  246. 00536 Edit_Z = Edit_Z + 1
  247. 00538 GOTO "Edit Bottom"
  248. 00540 "Edit Home Key"    REM                     ========= Home Key ===============
  249. 00542 IF ( Edit_Z = 1 ) THEN "Edit Beep Bottom"
  250. 00544 Edit_Z = 1
  251. 00546 GOTO "Edit Bottom"
  252. 00548 "Edit End Key" REM                     ========= End Key ==============
  253. 00550 :REM This search from the right-most position until a non-blank character
  254. 00552 :REM   is found or the left-most position is reached
  255. 00554 IF ( Edit_Z=LGTH_Z ) THEN "Edit Beep Bottom"
  256. 00556 Edit_Z = LGTH_Z
  257. 00558 WHILE ( Edit_Z > 1 ) AND ( PEEK(Thisptr+Edit_Z) = Edit_FLCH)
  258. 00560 Edit_Z = Edit_Z -1
  259. 00562 WEND : IF Edit_Z < LGTH_Z THEN Edit_Z = Edit_Z + 1 : ': next space open
  260. 00564 GOTO "Edit Bottom"
  261. 00566 "Edit Back Space" REM                   ========= Backspace Key ==============
  262. 00568 :REM Deletes Character to the Left of the cursor and "pulls" all data
  263. 00570 :REM  under and to the right of the cursor one position to the left
  264. 00572 IF Edit_Z = 1 THEN "Edit Beep Bottom"
  265. 00574 FOR BCK = Edit_Z-1 TO LGTH_Z-1
  266. 00576 POKE Thisptr+BCK, PEEK(Thisptr+BCK+1)
  267. 00578 NEXT BCK
  268. 00580 POKE Thisptr+LGTH_Z, Edit_FLCH
  269. 00582 Edit_Z = Edit_Z - 1 : REWRT = TRUE
  270. 00584 GOTO "Edit Bottom"
  271. 00586 "No Control Key Pressed"
  272. 00588 :REM  =============================================
  273. 00590 :REM  ===== Check For Valid Key Pressed ===========
  274. 00592 :REM  =============================================
  275. 00594 :
  276. 00596 IF ( NOT Isaski) THEN "Edit Beep Bottom"
  277. 00598 :
  278. 00600 :REM - Check For Only Numeric if format demands it
  279. 00602 :
  280. 00604 IF ( Edit_FMT = 1 ) AND ( INSTR(1,PSTR$(Alpha),Z_Key$) > 10) THEN "Edit Beep Bottom"
  281. 00606 IF ( Edit_FMT = 4 ) AND ( INSTR(1,PSTR$(Alpha),Z_Key$) > 12) THEN "Edit Beep Bottom"
  282. 00608 :
  283. 00610 LONG IF ( Edit_FMT = 3 )
  284. 00612 :REM  Assert : Check For "Y" or "N"
  285. 00614 :  Z_Key$ = UCASE$(Z_Key$)
  286. 00616 :  IF ( Z_Key$ <> "Y" ) AND ( Z_Key$ <> "N" ) THEN "Edit Beep Bottom"
  287. 00618 END IF
  288. 00620 :
  289. 00622 :REM =========================== Valid Key Pressed
  290. 00624 :REM
  291. 00626 :REM ==== Here is the only place for a new character to be updated to
  292. 00628 :REM         the string. You will only be here if an ascii character
  293. 00630 :REM         has been inputted and if it is in the valid format.
  294. 00632 :
  295. 00634 IF Edit_FMT = 0 THEN Z_Key$ = UCASE$(Z_Key$)
  296. 00636 :REM Check For Insert Status
  297. 00638 LONG IF Edit_INS
  298. 00640 :REM Assert : This will only shift the character one position to
  299. 00642 :REM          the right. The character will be inserted later
  300. 00644 :REM Check For Full String
  301. 00646 IF ( PEEK(Thisptr+LGTH_Z) <> Edit_FLCH ) THEN "Edit Beep Bottom"
  302. 00648 :REM IF String Lgth_Z is One, Loop will crash
  303. 00650 LONG IF LGTH_Z > 1
  304. 00652 FOR IZ = LGTH_Z TO Edit_Z+1 STEP -1
  305. 00654 POKE Thisptr+IZ, PEEK(Thisptr+IZ-1)
  306. 00656 NEXT IZ
  307. 00658 END IF
  308. 00660 REWRT = TRUE
  309. 00662 END IF
  310. 00664 LONG IF ASC(Z_Key$) = SP_C
  311. 00666 POKE Thisptr+Edit_Z, Edit_FLCH
  312. 00668 LOCATE COL+Edit_Z-1,ROW,0:PRINT CHR$(Edit_FLCH);
  313. 00670 XELSE
  314. 00672 POKE Thisptr+Edit_Z, ASC(Z_Key$)
  315. 00674 LOCATE COL+Edit_Z-1,ROW,0:PRINT Z_Key$;
  316. 00676 END IF
  317. 00678 LONG IF Edit_Z < LGTH_Z
  318. 00680 Edit_Z = Edit_Z + 1
  319. 00682 GOTO "Edit Bottom"
  320. 00684 XELSE
  321. 00686 :REM Assert : Field is full, Check to see if an exit is in order !
  322. 00688 IF Edit_LEAVE THEN KeyValue = ENTER:GOTO "Leave Edit Loop"
  323. 00690 END IF
  324. 00692 "Edit Beep Bottom"
  325. 00694 SOUND 500,500
  326. 00696 "Edit Bottom"
  327. 00698 WEND
  328. 00700 "Leave Edit Loop"
  329. 00702 REM == Check for Escape Key Pressed
  330. 00704 IF KeyValue = ESC THEN TEMPOLD$ = OLD$ + SPACE$(LGTH_Z-LEN(OLD$))
  331. 00706 FOR IZ = 1 TO LGTH_Z
  332. 00708 IF PEEK(Thisptr+IZ) = Edit_FLCH THEN POKE Thisptr+IZ,SP_C
  333. 00710 NEXT IZ
  334. 00712 REM == Clean Off Brackets before leaving
  335. 00714 COLOR ,(Edit_BR<<4)+Edit_FR
  336. 00716 LONG IF Edit_BRKT
  337. 00718 LOCATE COL-1,ROW,0    :PRINT " "
  338. 00720 LOCATE COL+LGTH_Z,ROW,0:PRINT " "
  339. 00722 END IF
  340. 00724 LOCATE COL,ROW,0:PRINT TEMPOLD$
  341. 00726 END FN = TEMPOLD$
  342. 00728 :REM
  343. 00730 :REM   End Of FN Edit$
  344. 00800 CLS:FIELD=1:REM: initialize field count
  345. 00810 FN Edit_DFLTS(1,7,7,1,32,TRUE,TRUE)
  346. 00820 FOR T=1 TO 10:LX(T)=10:LY(T)=T+4:LOCATE LX(T) - 4,LY(T):PRINT USING"##. ";T
  347. 00830 NEXT T
  348. 00840 PRINT TAB(10)"Press {F10} to Quit"
  349. 00890 Edit_Z=1:REM: initialize cursor location
  350. 00900 DO:': START OF Edit LOOP
  351. 00910 :IN$(FIELD)=FN Edit$(IN$(FIELD),LX(FIELD),LY(FIELD),20,2,Edit_Z)
  352. 00920 :IF KeyValue=UArrow THEN FIELD=FIELD-1 :': up Arrow
  353. 00930 :IF KeyValue=ENTER THEN FIELD=FIELD+1:': move down on enter
  354. 00940 :IF KeyValue=DArrow THEN FIELD=FIELD+1 :': down Arrow
  355. 00980 :IF FIELD<1 THEN FIELD=10
  356. 00982 :IF FIELD>10 THEN FIELD=1
  357. 00990 UNTIL KeyValue=F10:': END OF Edit LOOP
  358. 01000 :LOCATE 0,23:END
  359.  
  360.